<template>
  <div class="diantai-container">
    <Header />
    <div class="management-main">
      <div class="left-nav">
        <router-link 
          to="/buzhang/diantai/memberManagement"
          class="nav-item" 
          :class="{ 'active': $route.path.includes('memberManagement') }"
        >
          成员管理
        </router-link>
        <router-link 
          to="/buzhang/diantai/deptIntro"
          class="nav-item" 
          :class="{ 'active': $route.path.includes('deptIntro') }"
        >
          部门简介管理
        </router-link>

        <router-link 
          to="/buzhang/diantai/departmentMeeting"
          class="nav-item" 
          :class="{ 'active': $route.path.includes('departmentMeeting') }"
        >
          部门会议
        </router-link>
        <router-link 
          to="/buzhang/diantai/personalCenter"
          class="nav-item" 
          :class="{ 'active': $route.path.includes('personalCenter') }"
        >
          个人中心
        </router-link>
      </div>
      
      <div class="content-area">
        <router-view />
      </div>
    </div>
    
    <Footer />
  </div>
</template>

<script setup>
import Header from '@/components/Header.vue'
import Footer from '@/components/Footer.vue'
</script>

<style scoped>
.diantai-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f7fa;
}

.management-main {
  flex: 1;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 20px;
  gap: 20px;
  min-height: calc(100vh - 140px); /* 减去header和footer的高度 */
}

.left-nav {
  width: 200px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px 0;
}

.nav-item {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background-color: #e6f7ff;
  border-left-color: #1890ff;
  color: #1890ff;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.module-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.module-header h3 {
  margin: 0;
  color: #333;
}

.btn-primary {
  background-color: #1890ff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: #40a9ff;
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #333;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-secondary:hover {
  background-color: #d9d9d9;
}

/* 响应式设计优化 */
@media (max-width: 1200px) {
  .management-main {
    padding: 16px;
    gap: 16px;
  }
  
  .left-nav {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .management-main {
    flex-direction: column;
    padding: 12px;
    gap: 12px;
    min-height: calc(100vh - 120px);
  }
  
  .left-nav {
    width: 100%;
    order: 2;
  }
  
  .content-area {
    order: 1;
  }
}

@media (max-width: 480px) {
  .management-main {
    padding: 8px;
    gap: 8px;
    min-height: calc(100vh - 100px);
  }
  
  .left-nav {
    padding: 12px 0;
  }
  
  .nav-item {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .module-card {
    padding: 16px;
  }
}
</style>